package com.yl.auth.controller;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yl.auth.model.entity.Weiji;
import com.yl.auth.model.vo.WeijiVo;
import com.yl.auth.model.vo.WenyuVo;
import com.yl.auth.service.WeijiService;
import com.yl.common.result.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

@Api(tags = "小程序-精神慰藉")
@RestController
@RequestMapping("/admin/xiaochengxuweiji")
public class Xiaochengweiji {
    @Resource
    private WeijiService weijiService;

    @GetMapping("/getxiaoweiji")
    @ApiOperation(value = "小程序获取全部精神慰藉信息")
    public Result getxiaoweiji(){
        List<WeijiVo> weijiVoList = weijiService.getxiaoweiji();
        return Result.ok(weijiVoList);
    }

    @PostMapping("/addweiji")
    @ApiOperation(value = "添加慰藉")
    public Result addweiji(Weiji weiji){
        weijiService.save(weiji);
        return Result.ok();
    }
}
